package org.fhawk.microservice.produce;

import org.apache.tomcat.jdbc.pool.PoolProperties;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.Bean;

import javax.sql.XADataSource;

@SpringCloudApplication
public class ProduceApplication {
    public static void main(String[] args) {
        new SpringApplicationBuilder(ProduceApplication.class).web(true).run(args);
    }

    @Bean
    public XADataSource dataSource() {
        PoolProperties properties = new PoolProperties();
        properties.setDriverClassName("oracle.jdbc.driver.OracleDriver");
        properties.setUrl("jdbc:oracle:thin:@192.168.1.10:1521:orcl");
        properties.setUsername("ics");
        properties.setPassword("ics");
        XADataSource dataSource = new org.apache.tomcat.jdbc.pool.XADataSource(properties);
        return dataSource;
    }
}
